]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnail: Base n-workspaces on number of thumbs
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 17 Feb 2021 19:31:33 +0000 (20:31 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 19 Feb 2021 00:08:48 +0000 (01:08 +0100)
It's what we base our size request on, and what we actually allocate.
The difference usually doesn't matter right now, but will soon when
we animate the minimap itself.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3739

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1696>

js/ui/workspaceThumbnail.js

index 8d3cb53d18669dda7ed9187e34a4299fe47d8900..ad8dfbf53957ea80ba3b71ac1e7a74ce947c3437 100644 (file)
@@ -1257,9 +1257,7 @@ var ThumbnailsBox = GObject.registerClass({
         if (this._thumbnails.length == 0) // not visible
             return;
 
-        let workspaceManager = global.workspace_manager;
         let themeNode = this.get_theme_node();
-
         box = themeNode.get_content_box(box);
 
         const portholeWidth = this._porthole.width;
@@ -1267,7 +1265,7 @@ var ThumbnailsBox = GObject.registerClass({
         const spacing = themeNode.get_length('spacing');
 
         // Compute the scale we'll need once everything is updated
-        let nWorkspaces = workspaceManager.n_workspaces;
+        const nWorkspaces = this._thumbnails.length;
         let totalSpacing = (nWorkspaces - 1) * spacing;
         const availableWidth = (box.get_width() - totalSpacing) / nWorkspaces;